package ACWing.acwing每日一题._5991数字诗意;

import java.util.*;

public class Main2 {
    static Set<Long> set = new HashSet<>();

    static {
        for (int i = 0; i < 64; i++)
            set.add((long) Math.pow(2, i));
    }

    public static void main(String[] args) {
        // 打表

        Scanner scanner = new Scanner(System.in);
        int n=scanner.nextInt();
        int ans = 0;
        for(int i=0;i<n;i++){
            long t = scanner.nextLong();
            if(set.contains(t))
                ans++;
        }
        System.out.println(ans);
        scanner.close();

    }
}
